package com.example.order.pojo;

import com.google.gson.annotations.SerializedName;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Reservation {
    private String bill_id;
    private String window_id;
    private String consumer_id;
    private String quantity;
    private String total;
    private String dish_name;
    private int reservation_result;
    private String is_display;
    private String status;

    @SerializedName("pickup_time")
    private String pickupTime; // 将 pickup_time 修改为 String 类型

    private String button_status;

    public LocalDateTime getParsedPickupTime() {
        // 假设格式为yyyy-MM-dd HH:mm:ss
        if (pickupTime == null) {
            throw new IllegalArgumentException("pickup_time cannot be null");
        }

        return LocalDateTime.parse(pickupTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

    public String getBill_id() {
        return bill_id;
    }

    public void setBill_id(String bill_id) {
        this.bill_id = bill_id;
    }

    public String getWindow_id() {
        return window_id;
    }

    public void setWindow_id(String window_id) {
        this.window_id = window_id;
    }

    public String getConsumer_id() {
        return consumer_id;
    }

    public void setConsumer_id(String consumer_id) {
        this.consumer_id = consumer_id;
    }

    public String getQuantity() {
        return quantity;
    }

    public void setQuantity(String quantity) {
        this.quantity = quantity;
    }

    public String getTotal() {
        return total;
    }

    public void setTotal(String total) {
        this.total = total;
    }

    public String getDish_name() {
        return dish_name;
    }

    public void setDish_name(String dish_name) {
        this.dish_name = dish_name;
    }

    public int getReservation_result() {
        return reservation_result;
    }

    public void setReservation_result(int reservation_result) {
        this.reservation_result = reservation_result;
    }

    public String getIs_display() {
        return is_display;
    }

    public void setIs_display(String is_display) {
        this.is_display = is_display;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getPickupTime() {
        return pickupTime;
    }

    public void setPickupTime(String pickupTime) {
        this.pickupTime = pickupTime;
    }

    public String getButton_status() {
        return button_status;
    }

    public void setButton_status(String button_status) {
        this.button_status = button_status;
    }
}
